﻿var $carousel = $("#myCarousel").carousel({
  interval: 1000
});

$("#navbar ul li a").on('touchstart mousedown', function (e) {
  e.preventDefault();
  $(".tabbar .active").removeClass('active');
  $(this).addClass('active');
  $carousel.carousel($(this).parent().index());
  $carousel.carousel('pause');
});

$(".tabbar a").click(function (e) {
  e.preventDefault()
});

$("div.divmbg").click(function (e) {
    
  var $current = $(this);
  var src = $current.find("img")[0].src;
  var title = $($current.find(".weui_grid_label")[0]).html();
  var remark = $current.find("input").val();
  
  //var remark = $current.find("input")[0].val();
  //alert(remark);
  var $dialog = $('#dialog');
  
  var $lbl = $('#lbl');
  $lbl.html(remark);

  $dialog.find("img").attr("src", src);
  $dialog.find("#dialog_title").html(title);
  
  $dialog.show();
  $dialog.find('.weui_btn_dialog').one('click', function () {
    $dialog.hide();
  });
});
